<?php

/* Pages.php
 *
 * (C) 2012, StaySimple CMS team.
 *
 * This file is part of StaySimple.
 * http://code.google.com/p/stay-simple-cms/
 *
 * StaySimple is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * StaySimple is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with StaySimple.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Represents deleted pages.
 * 
 * While a page is normally an XML file in the <em>pages</em> folder, the deleted 
 * pages are a view to the backup folders for each page. A deleted page is found 
 * looking in the backups and selecting the last backup that has been created.
 * 
 * Thus, a deleted page should be undertanded as the last backup of a page that 
 * was removed and it contains the name of the page's backups folder, the date of
 * the last backup (that also represents the file that will be restored) and the 
 * title of the page so that users can easily selected a page to restore.
 */
class DeletedPage {

    private $name;
    private $title;
    private $deletedDate;

    public function __construct($name, $title, $deletedDate) {
        $this->name = $name;
        $this->title = $title;
        $this->deletedDate = $deletedDate;
    }

    /**
     * Returns the name of this page. The name is the name of the folder an not 
     * of any existing file since all backups are named after their creation date.
     * 
     * @return string The folder that represents this page.
     */
    public function getName() {
        return $this->name;
    }

    /**
     * The page title.
     * 
     * @return string The page title.
     */
    public function getTitle() {
        return $this->title;
    }

    /**
     * Returns the date when the backup that this object represents was created.
     * 
     * @return string The date for the last existing backup file.
     */
    public function getDeletedDate() {
        return $this->deletedDate;
    }

}
